package com.xiake.consultsystem.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class Constant {
    //公钥
    public static final String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCe7zMfNLHX8wCgYZW6Uzo0XdNDX4FneS0n0i/Tl5db40FeNlA7KTB2xb7AtRfrPb8RSMVutFjW/R4dV/sUzEc+T5Vb0ME/gxql9kUil2dhxzlRuxxXbGKo8kWeh0X5xViiFaaevsmmyyqBWgL9OqMtOSduiDgfCdrLCylxtAvL/wIDAQAB";

    //私钥
    public static final String PRIVATE_KEY = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJ7vMx80sdfzAKBhlbpTOjRd00NfgWd5LSfSL9OXl1vjQV42UDspMHbFvsC1F+s9vxFIxW60WNb9Hh1X+xTMRz5PlVvQwT+DGqX2RSKXZ2HHOVG7HFdsYqjyRZ6HRfnFWKIVpp6+yabLKoFaAv06oy05J26IOB8J2ssLKXG0C8v/AgMBAAECgYB1qVRJd/NpkgcWtOfqBw+CESwEJsJgXj9lyZ+KoCF372hHXSJMihPM+lxbwjWw/AdlvmAbsvxKPR18T9Qb85eRh8I8h2uYuB1dUEPuf+Sb5knfJs5SPS0bGXfv35vxJ+aYqXeaRZCzSRtfcKqnZSC0bTZyRfDLwVtadSWwijx2cQJBAN4O2WbQsbSlxqQAiQCfZw3l5focFi8QeC9LHyeAICCZSEP8oeycb3d/LeYSh+2u0AfVhopqEUZGOIlC8xDqz6MCQQC3OlEaO9udGciig+xVlIkhB38gEDHQY1vAKn6+S4zHI+p56o0HeT6T3nDXmWsjsVBhy3odIWa5IJO6mYY5nef1AkEAz16qo5ts+Lh/YpSlXJF/2bjCJemoxdbphbDvrSG33vmGRQdd5+rHJZ79LAhOLCa+WzKKbCRVcX0OOxDskPXXZQJASgp7yYEUvsgzhlCPCQor27f+zAMfThlIcz/41YcMDVDbKIb6lGGPQwupR8ZMQDEfzVT/NJRRwU+DwuzVC6VenQJBANZkeT0FY6RN31hW1fg2jdN02Ob9jFxDAyHC5b857G6ojt0bdwiZUAwISD23C0n/HtnZff4focyEIUwm57kPqiI=";

    //日期格式
    public static final String DATE_FORMAT = "yy-MM-dd";

    //超管账号
    public static final String SUPER_ADMIN_ACCOUNT = "XiaKe";

    //超管密码
    public static final String SUPER_ADMIN_PASSWORD = "xiake83420134";


    //普通管理员账号
    public static final String ADMIN_ACCOUNT = "teacher";

    //普通管理员账号密码
    public static final String ADMIN_PASSWORD = "654321";

    /**
     * 暂用方法: 获得BCypt加密后的密码
     */
    public  void getBcypt(){
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        //使用bcypt进行加密
        String encodePassword = bCryptPasswordEncoder.encode(Constant.ADMIN_PASSWORD);
        System.out.println(encodePassword);

    }

    /**
     * 暂用方法: 获得RSA加密后的超管密码
     */
    public void getRSA() {
        String enPasssword =  RSAUtil.encode(Constant.ADMIN_PASSWORD,Constant.PUBLIC_KEY);
        System.out.println(enPasssword);
        System.out.println(RSAUtil.decode(enPasssword,Constant.PRIVATE_KEY));
    }
}